﻿using System;
using System.Windows;
using MyFloridaHouse.libSvCommonUtilities;
using MyFloridaHouse.ServiceConn.DistrBldrSvcRef;

namespace MyFloridaHouse.libSvOpenDistricts.DataService
{
    public partial class ServiceDAL
    {
        private int _getDistrictShapeClippedRequestCount = 0;
        public int getDistrictShapeClippedRequestCount
        {
            get { return _getDistrictShapeClippedRequestCount; }
            set { if (_getDistrictShapeClippedRequestCount != value) { _getDistrictShapeClippedRequestCount = value; NotifyPropertyChanged("getDistrictShapeClippedRequestCount"); } }
        }

        public void GetDistrictShapeClipped(DistrictShapeClippedSTO sto, System.EventHandler<GetDistrictShapeClippedCompletedEventArgs> completedHandler)
        {
            try
            {
                //MyDistrictBuilderServiceClient proxy = new MyDistrictBuilderServiceClient(myRelativeBinding, myRelativeCensusDataServiceAddress);
                var proxy = new DistrBldrClient(_relativeBindingName);
                proxy.GetDistrictShapeClippedCompleted += completedHandler;
                proxy.GetDistrictShapeClippedAsync(sto);
                getDistrictShapeClippedRequestCount++;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
    }
}
